package ch5;

import java.util.Scanner;

public class Dengyao {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入等腰三角形的高度：");
		int h = in.nextInt();

		// 行号和*个数之间的关系：2*x-1
		for (int i = 1; i <= h; i++) {
			// i称为循环的当前值
			// 输出空格
			for (int j = 1; j <= h - i; j++) {
				System.out.print(" ");
			}

			// 输出*
			for (int j = 1; j <= 2 * i - 1; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
	}

}
